<extend name="Bbs/base"/>
<block name="main">
    <section class="container main">
        {$sysNotice}
        <div class="index-container clearfix">
            <div class="index-aside">
                <div class="panel">
                    <div class="panel-header">
                        <h3 class="panel-title bbs-title">{$bbs.name}</h3>
                    </div>
                    <div class="panel-body">
                        <div class="bbs-info">
                            <a class="photo bbs-photo" href="//bbs.wooo.wang/{$bbs.id}"><img src="//img.wooo.wang/{$bbs.avatar}"></a>
                            <p><strong>{$bbs.focus}</strong> 关注 • <strong>{$bbs.gx}</strong> 贡献度</p>
                            <p>{$bbs.desc}</p>
                            <p class="handle"><if condition="$focused"><a class="handle-focused" href="javascript:void(0)" id="focusBtn" data-mark="2">已关注</a><else/><a class="handle-focus" href="javascript:void(0)" id="focusBtn" data-mark="1">关注</a></if><a id="donationBtn" class="handle-donation" href="javascript:void(0)">捐赠</a></p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="index-main">
                <div class="panel">
                    <div class="panel-header topic-header">
                        <div class="bbs-cate-div">
                            <ul class="bbs-cate clearfix">
                                <li <if condition="$group eq -1">class="active"</if>>
                                    <a href="//bbs.wooo.wang/{$bbs.id}">全部</a>
                                </li>
                                <li <if condition="$group eq 0">class="active"</if>>
                                    <a href="//bbs.wooo.wang/{$bbs.id}/group/0">默认</a>
                                </li>
                                <volist name="cate" id="vo">
                                    <li <if condition="$group eq $key">class="active"</if>>
                                        <a href="//bbs.wooo.wang/{$bbs.id}/group/{$key}">{$vo}</a>
                                    </li>
                                </volist>
                            </ul>
                        </div>
                        <ul class="topic-filter">
                            <if condition="$group elt 0">
                                <li><a href="//bbs.wooo.wang/{$bbs.id}" <if condition="$filter neq 'elite'">class="active"</if>>最新</a></li>
                                <li><a href="//bbs.wooo.wang/{$bbs.id}/filter/elite" <if condition="$filter eq 'elite'">class="active"</if>>推荐</a></li>
                            </if>
                        </ul>
                    </div>
                    <div class="panel-body">
                        <ul class="index-list clearfix">
                            <if condition="$list">
                                <volist name="list" id="vo">
                                    <li>
                                        <a class="index-photo" href="//wooo.wang/u/{$vo.uid}"><img src="{$vo.avatar}"></a>
                                        <div class="index-content">
                                            <h4><a href="//bbs.wooo.wang/topic/{$vo['id']}">{$vo.title}</a></h4>
                                            <p><if condition="$cate[$vo['cid']]"><a href="//bbs.wooo.wang/{$bbs.id}/group/{$vo['cid']}"># {$cate[$vo['cid']]}</a><else/><a href="//bbs.wooo.wang/{$bbs.id}/group/0"># 默认</a></if> • <a href="//wooo.wang/u/{$vo.uid}">{$vo.nick}</a> 发起 <span>• {:formatCount($vo['reply'])} 回复 • {:formatCount($vo['visit'])} 浏览 • {:formatTime($vo['update'])}</span></p>
                                        </div>
                                    </li>
                                </volist>
                                <else/>
                                <li>
                                    <a class="index-photo" href="//bbs.wooo.wang/{$bbs.id}"><img src="//img.wooo.wang/{$bbs.avatar}"></a>
                                    <div class="index-content">
                                        <h4><a href="javascript:void(0)">{$bbs.name} 欢迎您！</a></h4>
                                        <p><a href="//bbs.wooo.wang/{$bbs.id}/group/0"># 默认</a> • <a href="//bbs.wooo.wang/{$bbs.id}">{$bbs.name}</a> 发起 <span>• {:formatCount($bbs['hf'])} 回复 • {:formatCount($bbs['visit'])} 浏览 • {:formatTime($bbs['create'])}</span></p>
                                    </div>
                                </li>
                            </if>
                        </ul>
                    </div>
                    <div class="panel-footer">
                        {$page}
                    </div>
                </div>
            </div>
            <div class="index-aside">
                <div class="panel">
                    <div class="panel-header">
                        <h3 class="panel-title">管委会主席</h3>
                    </div>
                    <div class="panel-body">
                        <ul class="manager-list clearfix">
                            <volist name="admin" id="vo">
                                <li>
                                    <a class="photo" href="//wooo.wang/u/{$vo['id']}"><img src="{$vo['avatar']}"></a><br>
                                    <a class="manager-name" href="//wooo.wang/u/{$vo['id']}">{$vo.nick}</a>
                                </li>
                            </volist>
                        </ul>
                    </div>
                    <div class="panel-footer">
                        <a class="show-more" href="{:U('/org/'.$bbs['id'])}">进入社区管理中心</a>
                    </div>
                </div>
                <if condition="$ad">
                    <div class="panel">
                        <div class="panel-header">
                            <h3 class="panel-title">广告</h3>
                        </div>
                        <div class="panel-body">
                            <volist name="ad" id="vo">
                                <a href="{$vo.url}" target="_blank"><img width="100%" src="{$vo.img}" title="{$vo.desc}"></a>
                            </volist>
                        </div>
                    </div>
                </if>
                <div class="panel">
                    <div class="panel-header">
                        <h3 class="panel-title">统计</h3>
                    </div>
                    <div class="panel-body">
                        <table class="tj-table">
                            <tr class="thead">
                                <td>文档</td>
                                <td>关注</td>
                                <td>贡献度</td>
                            </tr>
                            <tr class="strong-tr">
                                <td>{$bbs.docs}</td>
                                <td>{$bbs.focus}</td>
                                <td>{$bbs.gx}</td>
                            </tr>
                            <tr class="thead">
                                <td>话题</td>
                                <td>回复</td>
                                <td>浏览</td>
                            </tr>
                            <tr>
                                <td>{$bbs.tz}</td>
                                <td>{$bbs.hf}</td>
                                <td>{$bbs.visit}</td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </section>
<if condition="UID">
    <div class="modal hide" id="modal">
        <div class="modal-container" style="max-width:400px;margin-top:20%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="modal-close" id="modalClose"><span>&times;</span></button>
                    <h4 class="modal-title">捐赠贡献度</h4>
                </div>
                <div class="modal-body">
                    <div class="form">
                        <div class="form-item">
                            <input type="number" name="gx" id="gxInput" data-gx="{$user.gx}" min="1" max="{$user.gx}" placeholder="请填写您捐赠的贡献度...">
                        </div>
                    </div>
                    <p class="edit-tip">您当前拥有 <strong class="red" id="userAllGx">{$user.gx}</strong> 点贡献度...</p>
                </div>
                <div class="modal-footer">
                    <button class="modal-no" id="modalNo">取消</button>
                    <button class="modal-save no-save" id="modalOk" data-url="/bbs/donation/bid/{$bbs['id']}">确认</button>
                </div>
            </div>
        </div>
    </div>
</if>
</block>
<block name="js">
    <script>
        var bid = "{$bbs.id}";
    </script>
    <script src="__STATIC__/doc/js/bbs.js?v=__VERSION__"></script>
    <script src="__STATIC__/doc/js/donation.js?v=__VERSION__"></script>
</block>